/**
 * modelconstraintfactory.h is part of cbs-framework.
 *
 * cbs-framework is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * cbs-framework is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with cbs-framework.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef MODELCONSTRAINTFACTORY_H
#define MODELCONSTRAINTFACTORY_H

#include "../definitions.h"

#define GET_MODEL_CONSTRAINT_FACTORY() ( ModelConstraintFactory::Instance() )

// Forward declarations.
class ModelAllowIdlesConstraint;
class ModelMaxTimeConstraint;
class ModelPrecedenceConstraint;

class ModelConstraintFactory
{
public:
    ~ModelConstraintFactory() {}

    static ModelConstraintFactory & Instance();

    ModelAllowIdlesConstraint * CreateAllowIdleConstraint( bool a_allowIdle = false );

    ModelMaxTimeConstraint * CreateMaxTimeConstraint( tTime a_maxTime = MAX_TIME );

    ModelPrecedenceConstraint * CreatePrecedenceConstraint( const std::string & a_taskBefore, const std::string & a_taskAfter );

private:

    static ModelConstraintFactory m_instance;

    // Protect default constructor.
    ModelConstraintFactory() {}

    // Protect default copy constructor.
    ModelConstraintFactory( const ModelConstraintFactory & a_other );

    // Protect default operator =.
    ModelConstraintFactory & operator = ( const ModelConstraintFactory & a_other );

};

#endif // MODELCONSTRAINTFACTORY_H
